PREVIEW: Today you'll learn how to repeat code continuously until you want it to stop by using a while loop.

  • Click Run to see and use an example of the project you'll create.
  • Look at line 14 in the code. Can you find where choice gets assigned a new value?
  • Try playing the game and decide whether you want to play again or not!
  • When you are ready, click Submit and Next.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)